import { useEffect, useState } from 'react';
import { Message, Input, Form, Box, Grid, Card, DatePicker, Radio, Upload, Field, Rating } from '@alifd/next';
import { values } from '@alifd/next/types/util/object';
const FormItem = Form.Item;
const { Row, Col } = Grid;
const formItemLayout = {
    labelCol: { span: 1 },
    wrapperCol: { span: 23 },
};
const insetLayout = {
    labelCol: { fixedSpan: 3 },
};
export const YiwaiForm = (props: {
    defaultValue: any
    onChange: any
    id: any
}): JSX.Element => {
    const field = Field.useField({
        values: props.defaultValue,
    });
    return <Form {...formItemLayout} field={field} onChange={() => {
        props.onChange && props.onChange(field.getValues());
    }} style={{
        width: '100%'
    }}>
        <FormItem id="control-input" label={'人：'}>
            {JSON.stringify(props.extraInfo)}
            <Row gutter="4">
                <Col>
                    <FormItem
                        style={{ margin: 0 }}
                        labelAlign="inset"
                        {...insetLayout}
                        required
                        asterisk={false}
                    >
                        <Input {...field.init('ren')} placeholder="涉及那些人" />
                    </FormItem>
                </Col>
                <Col>
                    <FormItem
                        style={{ margin: 0 }}
                        labelAlign="inset"
                        {...insetLayout}
                        required
                        asterisk={false}
                    >
                        <Input {...field.init('ren_go')} placeholder="会怎么搞你，怎么应对" />
                    </FormItem>
                </Col>
            </Row>
        </FormItem>
        <FormItem id="control-input" label={'物：'}>
            <Row gutter="4">
                <Col>
                    <FormItem
                        style={{ margin: 0 }}
                        labelAlign="inset"
                        {...insetLayout}
                        required
                        asterisk={false}
                    >
                        <Input {...field.init('wu')} placeholder="涉及那些物" />
                    </FormItem>
                </Col>
                <Col>
                    <FormItem

                        style={{ margin: 0 }}
                        labelAlign="inset"
                        {...insetLayout}
                        required
                        asterisk={false}
                    >
                        <Input placeholder="怎么准备，时间线" />
                    </FormItem>
                </Col>
            </Row>
        </FormItem>
        <FormItem id="control-input" label={'我：'}>
            <Row gutter="4">
                <Col>
                    <FormItem

                        style={{ margin: 0 }}
                        labelAlign="inset"
                        {...insetLayout}
                        required
                        asterisk={false}
                    >
                        <Input {...field.init('wo')} placeholder="犹豫点事什么" />
                    </FormItem>
                </Col>
                <Col>
                    <FormItem
                        style={{ margin: 0 }}
                        labelAlign="inset"
                        {...insetLayout}
                        required
                        asterisk={false}
                    >
                        <Input {...field.init('wo_go')} placeholder="我会怎么犹豫，不好意思，怎么应对" />
                    </FormItem>
                </Col>
            </Row>
        </FormItem>
    </Form>;
};

export default YiwaiForm;
